<template>
	<div class="student">
		<h1>我是Student组件</h1>
		<h2>名字：{{name}}</h2>
		<h2>年龄：{{age}}</h2>
		<button @click="showInfo">点我展示学生信息</button>
	</div>
</template>

<script>
	export default {
		name:'Student',
		data() {
			return {
				name:'强',
				age:98
			}
		},
		methods: {
			showInfo(){
				alert(`我是${this.name}，我今年${this.age}岁了`)
			}
		},
	}
</script>

<style>
	.student{
		background-color: skyblue;
		padding: 10px;
	}
</style>